package com.pension.utils;

/**
 * @ClassName: demo
 * @Description: GOOD
 * @author: ZZL
 * @date: 2021/3/2  8:36
 */

import java.util.Random;

/**
 * @Title: randomName
 * @Description: 随机取名字
 * @param-simple 是否单姓
 * @param-len 生成姓名长度
 * @return String 名字
 */

public class RandomName {
    public static void main(String[] args) {
        /**随机产生昵称*/
//        HashSet<String> set = new HashSet<String>();
//        for (int i = 0; i < 10; i++) {
//            String chineseName = randomName(true,3);
//            if (!set.contains(chineseName)) {
//                set.add(chineseName);
//            }
//        }
//        Iterator<String> iterator = set.iterator();
//        while (iterator.hasNext()) {
//            System.err.print(iterator.next() + "\n");
//        }
        String chineseName = randomName(7);
        System.out.println(chineseName);

    }

    /**方法1*/
    public static String randomName(int simple) {
        //----------simple==1
        String sName[] = {
                "张伟","王伟","王芳","李伟","李娜","张敏","李静","王静","刘伟","王秀英","张丽","李秀英","王丽","张静","张秀英","李强",
                "王敏","李敏","王磊","刘洋"};
        //----------simple==2
        String sTime[]={
                "早上","中午","晚上"
        };
        //----------simple==3---------》社区养老服务---养老照料中心/社区养老服务驿站
        String sType1[]={
                "助餐服务","助浴服务","短期照料","日间照料","志愿服务","助洁服务","助医服务","精神关怀",
                "健康指导","康复护理","助行服务","心理慰藉","法律咨询","文化沙龙","器具租赁","呼叫服务",
                "代办服务","机构养老服务"
        };
        //----------simple==4---------》居家养老服务---养老照料中心/社区养老服务驿站
        String sType2[]={
                "送餐服务","上门助浴","助医服务","助洁服务","喘息服务","精神关怀","健康指导","康复护理","助行服务",
                "心理慰藉","法律咨询","代办服务"
        };
        //----------simple==5---------》社区医疗服务---社区卫生服务中心/站
        String sType3[]={
                "节日活动","中医健康大课堂","疫苗接种","医养结合服务","健康管理服务","中医药健康养老","脑疾病早期筛查与干预","用药咨询","门诊挂号",
                "注射、输液及换药","医技检查","转诊","康复治疗","护理服务","安宁疗护"
        };
        //----------simple==6---------》居家医疗服务---社区卫生服务中心/站
        String sType4[]={
                "线上讲堂","健康评估","医养结合服务","健康服务","上门巡诊","送药上门","用药咨询","远程医疗","家庭病床",
                "转诊","上门康复","上门护理","家庭护理病床","安宁疗护"
        };
        //----------simple==11---------》全部活动
        String sType5[]={
                "线上讲堂","健康评估","医养结合服务","健康服务","上门巡诊","送药上门","用药咨询","远程医疗","家庭病床",
                "转诊","上门康复","上门护理","家庭护理病床","安宁疗护", "节日活动","中医健康大课堂","疫苗接种","医养结合服务",
                "健康管理服务","中医药健康养老","脑疾病早期筛查与干预","用药咨询","门诊挂号",
                "注射、输液及换药","医技检查","转诊","康复治疗","护理服务","安宁疗护", "送餐服务","上门助浴","助医服务","助洁服务","喘息服务",
                "精神关怀","健康指导","康复护理","助行服务",
                "心理慰藉","法律咨询","代办服务", "助餐服务","助浴服务","短期照料","日间照料","志愿服务","助洁服务","助医服务","精神关怀",
                "健康指导","康复护理","助行服务","心理慰藉","法律咨询","文化沙龙","器具租赁","呼叫服务",
                "代办服务","机构养老服务"
        };

        //----------simple==7---------》养老照料中心/社区养老服务驿站
        String sPlace1[]={
               "养老照料中心", "社区养老服务驿站"
        };
        //----------simple==8---------》社区卫生服务中心/站
        String sPlace2[]={
                "社区卫生服务中心","社区卫生服务站"
        };
        String sDay[]={
           "2021-02-19","2021-03-21","2021-04-20","2021-05-18","2021-06-10","2021-08-20"
        };
        String sAddress[]={
               "石景山八角街道","石景山八宝山街道","石景山苹果园","石景山杨庄街道","石景山古城街道","石景山金顶街街道","石景山广宁街道","石景山五里坨街道",
                "石景山鲁谷街道","海淀区万寿路街道","海淀区羊坊店街道","海淀区甘家口街道","海淀区八里庄街道","海淀区紫竹院街道","海淀区北下关街道","海淀区北太平庄街道",
                "海淀区海淀街道","海淀区中关村","海淀区学院路街道","海淀区清河街道","海淀区青龙桥","海淀区香山街道","海淀区西三旗街道","海淀区马连洼街道","海淀区花园路街道",
                "海淀区田村街道","海淀区上地街道","海淀区曙光街道","海淀区燕园街道","海淀区清华园街道","海淀区永定路街道","海淀区万柳地区","海淀区东升地区","海淀区温泉地区",
                "海淀区四季青地区","海淀区西北旺地区","海淀区苏家坨地区","海淀区上庄地区"
        };
        //-----------12
        String sPlace3[]={
                "社区卫生服务中心","社区卫生服务站","养老照料中心", "社区养老服务驿站"
        };
        //-----------13
        String sClass[]={
                "社区养老服务","居家养老服务","医疗健康服务"
        };



        int sNameLen = sName.length;
        int sTimeLen = sTime.length;
        int sTypeLen1 = sType1.length;
        int sTypeLen2 = sType2.length;
        int sTypeLen3 = sType3.length;
        int sTypeLen4 = sType4.length;
        int sTypeLen5 = sType5.length;
        int sPlaceLen1 = sPlace1.length;
        int sPlaceLen2 = sPlace2.length;
        int sPlaceLen3 = sPlace3.length;
        int sDayLen = sDay.length;
        int sAddressLen = sAddress.length;
        int sClassLen = sClass.length;

        StringBuffer sb = new StringBuffer();
        Random random = new Random();

        switch (simple) {
            case 1:
                sb.append(sName[random.nextInt(sNameLen)]);
                break;
            case 2:
                sb.append(sTime[random.nextInt(sTimeLen)]);
                break;
            case 3:
                sb.append(sType1[random.nextInt(sTypeLen1)]);
                break;
            case 4:
                sb.append(sType2[random.nextInt(sTypeLen2)]);
                break;
            case 5:
                sb.append(sType3[random.nextInt(sTypeLen3)]);
                break;
            case 6:
                sb.append(sType4[random.nextInt(sTypeLen4)]);
                break;
            case 7:
                sb.append(sPlace1[random.nextInt(sPlaceLen1)]);
                break;
            case 8:
                sb.append(sPlace2[random.nextInt(sPlaceLen2)]);
                break;
            case 9:
                sb.append(sDay[random.nextInt(sDayLen)]);
                break;
            case 10:
                sb.append(sAddress[random.nextInt(sAddressLen)]);
                break;
            case 11:
                sb.append(sType5[random.nextInt(sTypeLen5)]);
                break;
            case 12:
                sb.append(sPlace3[random.nextInt(sPlaceLen3)]);
                break;
            case 13:
                sb.append(sClass[random.nextInt(sClassLen)]);
                break;
            default:
                sb.append(sName[random.nextInt(sNameLen)]);;
        }
        return sb.toString();

    }
}